# -*- coding: utf-8 -*-
"""
@File: kline_trend.py.py
@author: chenxialin
@time: 9月 26, 2025 20:39
"""
# models/kline_trend.py
from sqlalchemy import Column, Integer, String, Float, BigInteger
from mysql.database import Base

class KlineTrend(Base):
    __tablename__ = "kline_trend"

    id = Column(Integer, primary_key=True, index=True, autoincrement=True)
    code = Column(String(20), nullable=False, comment="股票代码")
    start_date = Column(BigInteger, nullable=False, comment="区间开始时间")
    end_date = Column(BigInteger, nullable=False, comment="区间结束时间")
    type = Column(Integer, nullable=False, comment="趋势类型")
    high = Column(Float, nullable=False, comment="区间最高值")
    low = Column(Float, nullable=False, comment="区间最低值")

    def __repr__(self):
        return f"<KlineTrend(code='{self.code}', start_date={self.start_date}, end_date={self.end_date})>"